<#-- 默认提醒列表 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<base href="${baseURL}">
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>提醒列表 - ${title}</title>
	<meta name="keywords" content="${keywords}"/>
	<meta name="description" content="${description}"/>
	<#-- 获取令牌 -->
	<meta name="csrfToken" content="${token}"/>
	<link rel="shortcut icon" type="image/x-icon" href="${baseURL}${commonPath}images/favicon.ico" media="screen" />
	<link href="${commonPath}css/common.css" type="text/css" rel="stylesheet" charset="utf-8">
	<link href="${commonPath}css/themify-icons/style.css" type="text/css" rel="stylesheet">
	<script language="javascript" src="${commonPath}js/tool.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/ajax.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/json2.js" type="text/javascript"></script>
	<script language="javascript" src="${commonPath}js/jquery/jquery.min.js" type="text/javascript"></script>
	<script type="text/javascript" src="${commonPath}js/jquery/jquery.letterAvatar.js" language="javascript"></script>
	<link href="${commonPath}js/layer/skin/default/layer.css"  type="text/css" rel="stylesheet"/>
	<script type="text/javascript" src="${commonPath}js/layer/layer.js" language="javascript"></script>
	
</head>
<script type="text/javascript" language="javascript"> 
	
	
</script>
<body>
<#-- 引入页头 -->
<@include action="${newPublic_2}"/>
<div class="skeleton">
	<div class="main wrap backgroundModule" >
		<#-- 引入服务导航 -->
		<@include action="${newPublic_4}"/>
		
		
		<div class="remindTitle">
            <h2>全部提醒</h2>
            <div class="markAsReadButton">
            	<span class="buttonBox">
					<button type="button" class="payButton" onclick="javascript:allRemindMarkAsRead()">全部标记已读</button>
				</span>
            </div>
        </div>
		
		
		<#if pageView.records?exists> 
			<div class="remindModule" >
				<ol class="remindList">
					<#list pageView.records as remind>
						<div class="remind">
							<div class="author">
								<a href="user/control/home?userName=${remind.senderUserName}">
									<#if remind.senderAvatarName != null>
										<img src="${remind.senderAvatarPath}${remind.senderAvatarName}" class='avatar' height='64px' width='64px'>
									<#else>
										<!--[if (IE)]><img  class='avatar' height='64px' width='64px' src="${commonPath}images/min_avata.png"><![endif]-->
										<!--[if !(IE)]><!--><img class='avatar' height='64px' width='64px' avatar="${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}" ><!--<![endif]-->
									</#if>
								</a>
								
								<div class="tipBottom">
									<span class="a-toolbar">
										<#if remind.status == 10><span>未读</span></#if>
										<#if remind.status == 20><span style="color: #009A29;">已读</span></#if>
										<a href="javascript:" onclick="deleteRemind('${remind.id}')"><i class="cms-trash" ></i>删除</a>
										
									</span>
								</div>
							</div>
							<div class="time">${remind.sendTime}</div>
							<div class="content" >
								<!--reportModule为前端借用‘举报’功能标记模块提示项的参数   10:话题  20:评论  30:评论回复  40:问题  50:答案   60:答案回复-->
								<#if remind.typeCode == 10>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}&commentId=${remind.friendTopicCommentId}&reportModule=20">${remind.topicTitle}</a>
									</cite> 
									评论了我的话题
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 20>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}&commentId=${remind.friendTopicCommentId}&replyId=${remind.friendTopicReplyId}&reportModule=30">${remind.topicTitle}</a>
									</cite> 
									回复了我的话题
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 30>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}&commentId=${remind.friendTopicCommentId}&reportModule=20">${remind.topicTitle}</a>
									</cite> 
									引用了我的评论
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 40>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}&commentId=${remind.topicCommentId}&replyId=${remind.friendTopicReplyId}&reportModule=30">${remind.topicTitle}</a>
									</cite> 
									回复了我的评论
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 50>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}&commentId=${remind.friendTopicCommentId}&replyId=${remind.friendTopicReplyId}&reportModule=30">${remind.topicTitle}</a>
									</cite> 
									回复了我回复过的评论
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 55>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}&commentId=${remind.friendTopicCommentId}&replyId=${remind.friendTopicReplyId}&reportModule=30">${remind.topicTitle}</a>
									</cite> 
									回复了我的评论回复
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 60>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}">${remind.topicTitle}</a>
									</cite> 
									解锁了我的话题
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 70>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}">${remind.topicTitle}</a>
									</cite> 
									赞了我的话题
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 80>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite>
									关注了我
								<#elseif remind.typeCode == 90>
									我关注的
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									发表了话题
									<cite>
										<a href="thread?topicId=${remind.topicId}">${remind.topicTitle}</a>
									</cite>
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 100>
									我关注的
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}&commentId=${remind.friendTopicCommentId}&reportModule=20">${remind.topicTitle}</a>
									</cite>
									发表了评论
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 110>
									我关注的
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="thread?topicId=${remind.topicId}&commentId=${remind.friendTopicCommentId}&replyId=${remind.friendTopicReplyId}&reportModule=30">${remind.topicTitle}</a>
									</cite>
									发表了话题回复
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 120>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="question?questionId=${remind.questionId}&answerId=${remind.friendQuestionAnswerId}&reportModule=50">${remind.questionTitle}</a>
									</cite> 
									回答了我的问题
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 130>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="question?questionId=${remind.questionId}&answerId=${remind.friendQuestionAnswerId}&replyId=${remind.friendQuestionReplyId}&reportModule=60">${remind.questionTitle}</a>
									</cite> 
									回复了我的问题
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 140>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="question?questionId=${remind.questionId}&answerId=${remind.questionAnswerId}&replyId=${remind.friendQuestionReplyId}&reportModule=60">${remind.questionTitle}</a>
									</cite> 
									回复了我的答案
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 150>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="question?questionId=${remind.questionId}&answerId=${remind.friendQuestionAnswerId}&replyId=${remind.friendQuestionReplyId}&reportModule=60">${remind.questionTitle}</a>
									</cite> 
									回复了我回复过的答案
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 160>
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="question?questionId=${remind.questionId}&answerId=${remind.friendQuestionAnswerId}&replyId=${remind.friendQuestionReplyId}&reportModule=60">${remind.questionTitle}</a>
									</cite> 
									回复了我的答案回复
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 170>
									我关注的
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									提了问题
									<cite>
										<a href="question?questionId=${remind.questionId}">${remind.questionTitle}</a>
									</cite>
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 180>
									我关注的
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="question?questionId=${remind.questionId}&answerId=${remind.friendQuestionAnswerId}&reportModule=50">${remind.questionTitle}</a>
									</cite>
									回答了问题
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								<#elseif remind.typeCode == 190>
									我关注的
									<cite>
										<#if remind.senderAccount == null || remind.senderAccount == ''>
											<span class="cancelAccount">此用户账号已注销</span>
										</#if>
										<a href="user/control/home?userName=${remind.senderUserName}">
											${(remind.senderNickname != null && remind.senderNickname??) ?string(remind.senderNickname , remind.senderAccount)}
										</a>
									</cite> 
									在
									<cite>
										<a href="question?questionId=${remind.questionId}&answerId=${remind.friendQuestionAnswerId}&replyId=${remind.friendQuestionReplyId}&reportModule=60">${remind.questionTitle}</a>
									</cite>
									发表了答案回复
									<div class="summary">
                                        ${remind.summary}
                                    </div>
								</#if>
							</div>
							<div class="clearfix"></div>
						</div>
					</#list>
				</ol>
				<div class="remindPage">
					<@include action="${newPublic_1}"/>
				</div>
			</div>
			
		</#if>
	
	
	</div>


</div>






<script type="text/javascript" language="javascript"> 

//全部提醒状态标记为已读
function allRemindMarkAsRead(){
	var parameter = "";//URI参数
	//从meta标签获取令牌
	parameter += "&token="+getCsrf();
	
	if(parameter.indexOf("&") == 0){
		parameter = parameter.substring(1,parameter.length);
	}
	post_request(function(value){
		if(value != ""){
			var returnValue = JSON.parse(value);//JSON转为对象
			for(var key in returnValue){
				if(key == "success"){	
					var success = returnValue[key];	
					if(success == "true"){
						layer.msg('标记全部提醒已读成功,3秒后刷新页面', 
							{
							  time: 3000 //3秒关闭（如果不配置，默认是3秒）
							},function(){
								//关闭后的操作
					        	document.location.reload();//刷新页面
							}
						);
					}
				}else if(key == "error"){
					var errorValue = returnValue[key];
					var htmlValue = "";
					var i = 0;
					for(var error in errorValue){
						if(error != ""){	
							i++;
							htmlValue += "&nbsp;&nbsp;"+i+"、"+errorValue[error]+"<br>";
						}
					}
					
					layer.open({
					  type: 1,
					  title: '错误', 
					  skin: 'layui-layer-rim', //加上边框
					  area: ['300px', '150px'], //宽高
					  content: htmlValue
					});
					
				}
			}
		}
	},
		getBasePath()+"user/control/allRemindMarkAsRead?timestamp=" + new Date().getTime(), true,parameter);	
}


//删除提醒
function deleteRemind(remindId){
	var parameter = "";//URI参数
	parameter += "&remindId="+remindId;
	//从meta标签获取令牌
	parameter += "&token="+getCsrf();
	
	if(parameter.indexOf("&") == 0){
		parameter = parameter.substring(1,parameter.length);
	}
	post_request(function(value){
		if(value != ""){
			var returnValue = JSON.parse(value);//JSON转为对象
			for(var key in returnValue){
				if(key == "success"){	
					var success = returnValue[key];	
					if(success == "true"){
						layer.msg('删除提醒成功,3秒后刷新页面', 
							{
							  time: 3000 //3秒关闭（如果不配置，默认是3秒）
							},function(){
								//关闭后的操作
					        	document.location.reload();//刷新页面
							}
						);
					}
				}else if(key == "error"){
					var errorValue = returnValue[key];
					var htmlValue = "";
					var i = 0;
					for(var error in errorValue){
						if(error != ""){	
							i++;
							htmlValue += "&nbsp;&nbsp;"+i+"、"+errorValue[error]+"<br>";
						}
					}
					
					layer.open({
					  type: 1,
					  title: '错误', 
					  skin: 'layui-layer-rim', //加上边框
					  area: ['300px', '150px'], //宽高
					  content: htmlValue
					});
					
				}
			}
		}
	},
		getBasePath()+"user/control/deleteRemind?timestamp=" + new Date().getTime(), true,parameter);	
}
</script>



<#--引入页脚-->
<@include action="${newPublic_3}"/>
</body>

</html>